import {BaseModel} from "../BaseModel";

export class UserClassTime extends BaseModel{

    constructor(){
        super();
        this.symbolName = "UserClassTime";
        this.tableName = "t_rec_user_class_time";
        this.id = '';//主键id，是事件表的startId
        this.userId = '';//用户id
        this.btwTime = -1;//间隔时间，即两次点击事件的间隔时间
        this.reverse1 = '';//用户上课事件创建时间
        this.reverse2 = '';//备用字段2
        this.reverse3 = '';//备用字段3
    }

    dbMapper(){
        return {
            id: 'id',
            userId: 'user_id',
            btwTime: 'btw_time',
            reverse1: 'reverse1',
            reverse2: 'reverse2',
            reverse3: 'reverse3'
        }
    }

    /**
     * 输出转换
     * @param obj
     * @returns {Book}
     */
    mappingModel(obj){
        let userClassTime = new UserClassTime();
        userClassTime.id = obj.id ? obj.id : ''
        userClassTime.userId = obj.user_id ? obj.user_id : ''
        userClassTime.btwTime = obj.btw_time ? obj.btw_time : -1
        userClassTime.reverse1 = obj.reverse1 ? obj.reverse1 : ''
        userClassTime.reverse2 = obj.reverse2 ? obj.reverse2 : ''
        userClassTime.reverse3 = obj.reverse3 ? obj.reverse3 : ''
        return userClassTime;
    }

}
